home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PRINTER / PROHP.ARJ / DSHADOWT.PRG < prev    next >
Text File  |  1992-06-23  |  2KB  |  49 lines

  1. /*
  2.   ┌─────────────────────────────────────────────────────────────────────────┐
  3.   │                                                                         │
  4.   │   Program : shadowt.prg                                                 │
  5.   │                                                                         │
  6.   │   Purpose : Create 9 boxes  showing the different shadow types.         │
  7.   │             You can also see how to center an array of text             │
  8.   │             inside a box using code block.                              │
  9.   │                                                                         │
  10.   │   Author  : Copyright (C) 1992, I.L.A.,Inc. All Rights reserved.        │
  11.   │                                                                         │
  12.   │   Comments: This source code may be distributed and used freely         │
  13.   │             provided that the copyright notice is not removed.          │
  14.   │                                                                         │
  15.   └─────────────────────────────────────────────────────────────────────────┘
  16. */
  17.  
  18. #include "prohp.ch"
  19.  
  20. proc main()
  21. Local nTop:=5,nLeft:=1, nHeight := 1, nWidth:=1, nSp:=0.5,b
  22. Local nOrigT:=nTop, nOrigL:=nLeft
  23. Local bSt := {|i| HP_aatsay(nTop+1/HP_data(D_LPI)+(nHeight-HProw2i(3))/2,;
  24.                 nLeft+nWidth/2,{"Shadow","Type","#"+str(i,2)},,"C")}
  25. HP_init()
  26. set2print("dshadowt.hpc")
  27.  
  28. HP_pitch(16)  // select font
  29. HP_lpi(8)       // LPI
  30. b:=1
  31. HPshadow(.t.)   // make shadow boxes
  32. HPsetshadow(,GFILLBLACK)  // make shadow black
  33. while b <= 9
  34.    HPsetshadow(,,,b)  // change shadow  type
  35.    HP_box(nTop,nLeft,nHeight,nWidth)    // draw box
  36.    eval(bSt,b)  // evaluate block to print array of text inside box
  37.    b++
  38.    if b%3=1     // up a row
  39.       nTop-=nHeight+nSp
  40.       nLeft:=nOrigL
  41.    else
  42.       nLeft+=nWidth+nSp  // move to the right
  43.    endif
  44. enddo
  45. HP_reset()
  46. set2screen()
  47. return
  48.  
  49.